using System; 
using System.Text; 
using System.Data;
using System.Data.SqlClient;
using System.Data.Common;
using System.Collections;
using System.Collections.Generic;
using System.ComponentModel;
using System.Configuration; 
using System.Xml; 
using System.Xml.Serialization;
using SubSonic; 
using SubSonic.Utilities;
namespace Adex
{
	/// <summary>
	/// Strongly-typed collection for the Template class.
	/// </summary>
    [Serializable]
	public partial class TemplateCollection : ActiveList<Template, TemplateCollection>
	{	   
		public TemplateCollection() {}
        
        /// <summary>
		/// Filters an existing collection based on the set criteria. This is an in-memory filter
		/// Thanks to developingchris for this!
        /// </summary>
        /// <returns>TemplateCollection</returns>
		public TemplateCollection Filter()
        {
            for (int i = this.Count - 1; i > -1; i--)
            {
                Template o = this[i];
                foreach (SubSonic.Where w in this.wheres)
                {
                    bool remove = false;
                    System.Reflection.PropertyInfo pi = o.GetType().GetProperty(w.ColumnName);
                    if (pi.CanRead)
                    {
                        object val = pi.GetValue(o, null);
                        switch (w.Comparison)
                        {
                            case SubSonic.Comparison.Equals:
                                if (!val.Equals(w.ParameterValue))
                                {
                                    remove = true;
                                }
                                break;
                        }
                    }
                    if (remove)
                    {
                        this.Remove(o);
                        break;
                    }
                }
            }
            return this;
        }
		
		
	}
	/// <summary>
	/// This is an ActiveRecord class which wraps the TEMPLATE table.
	/// </summary>
	[Serializable]
	public partial class Template : ActiveRecord<Template>, IActiveRecord
	{
		#region .ctors and Default Settings
		
		public Template()
		{
		  SetSQLProps();
		  InitSetDefaults();
		  MarkNew();
		}
		
		private void InitSetDefaults() { SetDefaults(); }
		
		public Template(bool useDatabaseDefaults)
		{
			SetSQLProps();
			if(useDatabaseDefaults)
				ForceDefaults();
			MarkNew();
		}
        
		public Template(object keyID)
		{
			SetSQLProps();
			InitSetDefaults();
			LoadByKey(keyID);
		}
		 
		public Template(string columnName, object columnValue)
		{
			SetSQLProps();
			InitSetDefaults();
			LoadByParam(columnName,columnValue);
		}
		
		protected static void SetSQLProps() { GetTableSchema(); }
		
		#endregion
		
		#region Schema and Query Accessor	
		public static Query CreateQuery() { return new Query(Schema); }
		public static TableSchema.Table Schema
		{
			get
			{
				if (BaseSchema == null)
					SetSQLProps();
				return BaseSchema;
			}
		}
		
		private static void GetTableSchema() 
		{
			if(!IsSchemaInitialized)
			{
				//Schema declaration
				TableSchema.Table schema = new TableSchema.Table("TEMPLATE", TableType.Table, DataService.GetInstance("Adex"));
				schema.Columns = new TableSchema.TableColumnCollection();
				schema.SchemaName = @"dbo";
				//columns
				
				TableSchema.TableColumn colvarId = new TableSchema.TableColumn(schema);
				colvarId.ColumnName = "ID";
				colvarId.DataType = DbType.Int64;
				colvarId.MaxLength = 0;
				colvarId.AutoIncrement = true;
				colvarId.IsNullable = false;
				colvarId.IsPrimaryKey = true;
				colvarId.IsForeignKey = false;
				colvarId.IsReadOnly = false;
				colvarId.DefaultSetting = @"";
				colvarId.ForeignKeyTableName = "";
				schema.Columns.Add(colvarId);
				
				TableSchema.TableColumn colvarUserID = new TableSchema.TableColumn(schema);
				colvarUserID.ColumnName = "UserID";
				colvarUserID.DataType = DbType.Int32;
				colvarUserID.MaxLength = 0;
				colvarUserID.AutoIncrement = false;
				colvarUserID.IsNullable = false;
				colvarUserID.IsPrimaryKey = false;
				colvarUserID.IsForeignKey = false;
				colvarUserID.IsReadOnly = false;
				colvarUserID.DefaultSetting = @"";
				colvarUserID.ForeignKeyTableName = "";
				schema.Columns.Add(colvarUserID);
				
				TableSchema.TableColumn colvarSlide1 = new TableSchema.TableColumn(schema);
				colvarSlide1.ColumnName = "Slide1";
				colvarSlide1.DataType = DbType.String;
				colvarSlide1.MaxLength = 50;
				colvarSlide1.AutoIncrement = false;
				colvarSlide1.IsNullable = true;
				colvarSlide1.IsPrimaryKey = false;
				colvarSlide1.IsForeignKey = false;
				colvarSlide1.IsReadOnly = false;
				colvarSlide1.DefaultSetting = @"";
				colvarSlide1.ForeignKeyTableName = "";
				schema.Columns.Add(colvarSlide1);
				
				TableSchema.TableColumn colvarSlide2 = new TableSchema.TableColumn(schema);
				colvarSlide2.ColumnName = "Slide2";
				colvarSlide2.DataType = DbType.String;
				colvarSlide2.MaxLength = 50;
				colvarSlide2.AutoIncrement = false;
				colvarSlide2.IsNullable = true;
				colvarSlide2.IsPrimaryKey = false;
				colvarSlide2.IsForeignKey = false;
				colvarSlide2.IsReadOnly = false;
				colvarSlide2.DefaultSetting = @"";
				colvarSlide2.ForeignKeyTableName = "";
				schema.Columns.Add(colvarSlide2);
				
				TableSchema.TableColumn colvarSlide3 = new TableSchema.TableColumn(schema);
				colvarSlide3.ColumnName = "Slide3";
				colvarSlide3.DataType = DbType.String;
				colvarSlide3.MaxLength = 50;
				colvarSlide3.AutoIncrement = false;
				colvarSlide3.IsNullable = true;
				colvarSlide3.IsPrimaryKey = false;
				colvarSlide3.IsForeignKey = false;
				colvarSlide3.IsReadOnly = false;
				colvarSlide3.DefaultSetting = @"";
				colvarSlide3.ForeignKeyTableName = "";
				schema.Columns.Add(colvarSlide3);
				
				TableSchema.TableColumn colvarSlide4 = new TableSchema.TableColumn(schema);
				colvarSlide4.ColumnName = "Slide4";
				colvarSlide4.DataType = DbType.String;
				colvarSlide4.MaxLength = 50;
				colvarSlide4.AutoIncrement = false;
				colvarSlide4.IsNullable = true;
				colvarSlide4.IsPrimaryKey = false;
				colvarSlide4.IsForeignKey = false;
				colvarSlide4.IsReadOnly = false;
				colvarSlide4.DefaultSetting = @"";
				colvarSlide4.ForeignKeyTableName = "";
				schema.Columns.Add(colvarSlide4);
				
				TableSchema.TableColumn colvarSlide5 = new TableSchema.TableColumn(schema);
				colvarSlide5.ColumnName = "Slide5";
				colvarSlide5.DataType = DbType.String;
				colvarSlide5.MaxLength = 50;
				colvarSlide5.AutoIncrement = false;
				colvarSlide5.IsNullable = true;
				colvarSlide5.IsPrimaryKey = false;
				colvarSlide5.IsForeignKey = false;
				colvarSlide5.IsReadOnly = false;
				colvarSlide5.DefaultSetting = @"";
				colvarSlide5.ForeignKeyTableName = "";
				schema.Columns.Add(colvarSlide5);
				
				TableSchema.TableColumn colvarSlide6 = new TableSchema.TableColumn(schema);
				colvarSlide6.ColumnName = "Slide6";
				colvarSlide6.DataType = DbType.String;
				colvarSlide6.MaxLength = 50;
				colvarSlide6.AutoIncrement = false;
				colvarSlide6.IsNullable = true;
				colvarSlide6.IsPrimaryKey = false;
				colvarSlide6.IsForeignKey = false;
				colvarSlide6.IsReadOnly = false;
				colvarSlide6.DefaultSetting = @"";
				colvarSlide6.ForeignKeyTableName = "";
				schema.Columns.Add(colvarSlide6);
				
				TableSchema.TableColumn colvarSlide7 = new TableSchema.TableColumn(schema);
				colvarSlide7.ColumnName = "Slide7";
				colvarSlide7.DataType = DbType.String;
				colvarSlide7.MaxLength = 50;
				colvarSlide7.AutoIncrement = false;
				colvarSlide7.IsNullable = true;
				colvarSlide7.IsPrimaryKey = false;
				colvarSlide7.IsForeignKey = false;
				colvarSlide7.IsReadOnly = false;
				colvarSlide7.DefaultSetting = @"";
				colvarSlide7.ForeignKeyTableName = "";
				schema.Columns.Add(colvarSlide7);
				
				TableSchema.TableColumn colvarSlide8 = new TableSchema.TableColumn(schema);
				colvarSlide8.ColumnName = "Slide8";
				colvarSlide8.DataType = DbType.String;
				colvarSlide8.MaxLength = 50;
				colvarSlide8.AutoIncrement = false;
				colvarSlide8.IsNullable = true;
				colvarSlide8.IsPrimaryKey = false;
				colvarSlide8.IsForeignKey = false;
				colvarSlide8.IsReadOnly = false;
				colvarSlide8.DefaultSetting = @"";
				colvarSlide8.ForeignKeyTableName = "";
				schema.Columns.Add(colvarSlide8);
				
				TableSchema.TableColumn colvarTvSmall = new TableSchema.TableColumn(schema);
				colvarTvSmall.ColumnName = "TV_small";
				colvarTvSmall.DataType = DbType.String;
				colvarTvSmall.MaxLength = 50;
				colvarTvSmall.AutoIncrement = false;
				colvarTvSmall.IsNullable = true;
				colvarTvSmall.IsPrimaryKey = false;
				colvarTvSmall.IsForeignKey = false;
				colvarTvSmall.IsReadOnly = false;
				colvarTvSmall.DefaultSetting = @"";
				colvarTvSmall.ForeignKeyTableName = "";
				schema.Columns.Add(colvarTvSmall);
				
				TableSchema.TableColumn colvarTvBig = new TableSchema.TableColumn(schema);
				colvarTvBig.ColumnName = "TV_Big";
				colvarTvBig.DataType = DbType.String;
				colvarTvBig.MaxLength = 50;
				colvarTvBig.AutoIncrement = false;
				colvarTvBig.IsNullable = true;
				colvarTvBig.IsPrimaryKey = false;
				colvarTvBig.IsForeignKey = false;
				colvarTvBig.IsReadOnly = false;
				colvarTvBig.DefaultSetting = @"";
				colvarTvBig.ForeignKeyTableName = "";
				schema.Columns.Add(colvarTvBig);
				
				TableSchema.TableColumn colvarCableSmall = new TableSchema.TableColumn(schema);
				colvarCableSmall.ColumnName = "cable_small";
				colvarCableSmall.DataType = DbType.String;
				colvarCableSmall.MaxLength = 50;
				colvarCableSmall.AutoIncrement = false;
				colvarCableSmall.IsNullable = true;
				colvarCableSmall.IsPrimaryKey = false;
				colvarCableSmall.IsForeignKey = false;
				colvarCableSmall.IsReadOnly = false;
				colvarCableSmall.DefaultSetting = @"";
				colvarCableSmall.ForeignKeyTableName = "";
				schema.Columns.Add(colvarCableSmall);
				
				TableSchema.TableColumn colvarCableBig = new TableSchema.TableColumn(schema);
				colvarCableBig.ColumnName = "Cable_Big";
				colvarCableBig.DataType = DbType.String;
				colvarCableBig.MaxLength = 50;
				colvarCableBig.AutoIncrement = false;
				colvarCableBig.IsNullable = true;
				colvarCableBig.IsPrimaryKey = false;
				colvarCableBig.IsForeignKey = false;
				colvarCableBig.IsReadOnly = false;
				colvarCableBig.DefaultSetting = @"";
				colvarCableBig.ForeignKeyTableName = "";
				schema.Columns.Add(colvarCableBig);
				
				TableSchema.TableColumn colvarRadioSmall = new TableSchema.TableColumn(schema);
				colvarRadioSmall.ColumnName = "Radio_small";
				colvarRadioSmall.DataType = DbType.String;
				colvarRadioSmall.MaxLength = 50;
				colvarRadioSmall.AutoIncrement = false;
				colvarRadioSmall.IsNullable = true;
				colvarRadioSmall.IsPrimaryKey = false;
				colvarRadioSmall.IsForeignKey = false;
				colvarRadioSmall.IsReadOnly = false;
				colvarRadioSmall.DefaultSetting = @"";
				colvarRadioSmall.ForeignKeyTableName = "";
				schema.Columns.Add(colvarRadioSmall);
				
				TableSchema.TableColumn colvarRadioBig = new TableSchema.TableColumn(schema);
				colvarRadioBig.ColumnName = "Radio_Big";
				colvarRadioBig.DataType = DbType.String;
				colvarRadioBig.MaxLength = 50;
				colvarRadioBig.AutoIncrement = false;
				colvarRadioBig.IsNullable = true;
				colvarRadioBig.IsPrimaryKey = false;
				colvarRadioBig.IsForeignKey = false;
				colvarRadioBig.IsReadOnly = false;
				colvarRadioBig.DefaultSetting = @"";
				colvarRadioBig.ForeignKeyTableName = "";
				schema.Columns.Add(colvarRadioBig);
				
				TableSchema.TableColumn colvarRadioIntSmall = new TableSchema.TableColumn(schema);
				colvarRadioIntSmall.ColumnName = "Radio_Int_small";
				colvarRadioIntSmall.DataType = DbType.String;
				colvarRadioIntSmall.MaxLength = 50;
				colvarRadioIntSmall.AutoIncrement = false;
				colvarRadioIntSmall.IsNullable = true;
				colvarRadioIntSmall.IsPrimaryKey = false;
				colvarRadioIntSmall.IsForeignKey = false;
				colvarRadioIntSmall.IsReadOnly = false;
				colvarRadioIntSmall.DefaultSetting = @"";
				colvarRadioIntSmall.ForeignKeyTableName = "";
				schema.Columns.Add(colvarRadioIntSmall);
				
				TableSchema.TableColumn colvarRadioIntBig = new TableSchema.TableColumn(schema);
				colvarRadioIntBig.ColumnName = "Radio_Int_Big";
				colvarRadioIntBig.DataType = DbType.String;
				colvarRadioIntBig.MaxLength = 50;
				colvarRadioIntBig.AutoIncrement = false;
				colvarRadioIntBig.IsNullable = true;
				colvarRadioIntBig.IsPrimaryKey = false;
				colvarRadioIntBig.IsForeignKey = false;
				colvarRadioIntBig.IsReadOnly = false;
				colvarRadioIntBig.DefaultSetting = @"";
				colvarRadioIntBig.ForeignKeyTableName = "";
				schema.Columns.Add(colvarRadioIntBig);
				
				TableSchema.TableColumn colvarOutdoorSmall = new TableSchema.TableColumn(schema);
				colvarOutdoorSmall.ColumnName = "Outdoor_small";
				colvarOutdoorSmall.DataType = DbType.String;
				colvarOutdoorSmall.MaxLength = 50;
				colvarOutdoorSmall.AutoIncrement = false;
				colvarOutdoorSmall.IsNullable = true;
				colvarOutdoorSmall.IsPrimaryKey = false;
				colvarOutdoorSmall.IsForeignKey = false;
				colvarOutdoorSmall.IsReadOnly = false;
				colvarOutdoorSmall.DefaultSetting = @"";
				colvarOutdoorSmall.ForeignKeyTableName = "";
				schema.Columns.Add(colvarOutdoorSmall);
				
				TableSchema.TableColumn colvarOutdoorBig = new TableSchema.TableColumn(schema);
				colvarOutdoorBig.ColumnName = "Outdoor_Big";
				colvarOutdoorBig.DataType = DbType.String;
				colvarOutdoorBig.MaxLength = 50;
				colvarOutdoorBig.AutoIncrement = false;
				colvarOutdoorBig.IsNullable = true;
				colvarOutdoorBig.IsPrimaryKey = false;
				colvarOutdoorBig.IsForeignKey = false;
				colvarOutdoorBig.IsReadOnly = false;
				colvarOutdoorBig.DefaultSetting = @"";
				colvarOutdoorBig.ForeignKeyTableName = "";
				schema.Columns.Add(colvarOutdoorBig);
				
				TableSchema.TableColumn colvarOutdoorIntSmall = new TableSchema.TableColumn(schema);
				colvarOutdoorIntSmall.ColumnName = "Outdoor_Int_small";
				colvarOutdoorIntSmall.DataType = DbType.String;
				colvarOutdoorIntSmall.MaxLength = 50;
				colvarOutdoorIntSmall.AutoIncrement = false;
				colvarOutdoorIntSmall.IsNullable = true;
				colvarOutdoorIntSmall.IsPrimaryKey = false;
				colvarOutdoorIntSmall.IsForeignKey = false;
				colvarOutdoorIntSmall.IsReadOnly = false;
				colvarOutdoorIntSmall.DefaultSetting = @"";
				colvarOutdoorIntSmall.ForeignKeyTableName = "";
				schema.Columns.Add(colvarOutdoorIntSmall);
				
				TableSchema.TableColumn colvarOutdoorIntBig = new TableSchema.TableColumn(schema);
				colvarOutdoorIntBig.ColumnName = "Outdoor_Int_Big";
				colvarOutdoorIntBig.DataType = DbType.String;
				colvarOutdoorIntBig.MaxLength = 50;
				colvarOutdoorIntBig.AutoIncrement = false;
				colvarOutdoorIntBig.IsNullable = true;
				colvarOutdoorIntBig.IsPrimaryKey = false;
				colvarOutdoorIntBig.IsForeignKey = false;
				colvarOutdoorIntBig.IsReadOnly = false;
				colvarOutdoorIntBig.DefaultSetting = @"";
				colvarOutdoorIntBig.ForeignKeyTableName = "";
				schema.Columns.Add(colvarOutdoorIntBig);
				
				TableSchema.TableColumn colvarInternetBig = new TableSchema.TableColumn(schema);
				colvarInternetBig.ColumnName = "Internet_big";
				colvarInternetBig.DataType = DbType.String;
				colvarInternetBig.MaxLength = 50;
				colvarInternetBig.AutoIncrement = false;
				colvarInternetBig.IsNullable = true;
				colvarInternetBig.IsPrimaryKey = false;
				colvarInternetBig.IsForeignKey = false;
				colvarInternetBig.IsReadOnly = false;
				colvarInternetBig.DefaultSetting = @"";
				colvarInternetBig.ForeignKeyTableName = "";
				schema.Columns.Add(colvarInternetBig);
				
				TableSchema.TableColumn colvarInternetSmall = new TableSchema.TableColumn(schema);
				colvarInternetSmall.ColumnName = "Internet_small";
				colvarInternetSmall.DataType = DbType.String;
				colvarInternetSmall.MaxLength = 50;
				colvarInternetSmall.AutoIncrement = false;
				colvarInternetSmall.IsNullable = true;
				colvarInternetSmall.IsPrimaryKey = false;
				colvarInternetSmall.IsForeignKey = false;
				colvarInternetSmall.IsReadOnly = false;
				colvarInternetSmall.DefaultSetting = @"";
				colvarInternetSmall.ForeignKeyTableName = "";
				schema.Columns.Add(colvarInternetSmall);
				
				TableSchema.TableColumn colvarPressBig = new TableSchema.TableColumn(schema);
				colvarPressBig.ColumnName = "Press_Big";
				colvarPressBig.DataType = DbType.String;
				colvarPressBig.MaxLength = 50;
				colvarPressBig.AutoIncrement = false;
				colvarPressBig.IsNullable = true;
				colvarPressBig.IsPrimaryKey = false;
				colvarPressBig.IsForeignKey = false;
				colvarPressBig.IsReadOnly = false;
				colvarPressBig.DefaultSetting = @"";
				colvarPressBig.ForeignKeyTableName = "";
				schema.Columns.Add(colvarPressBig);
				
				TableSchema.TableColumn colvarPressSmall = new TableSchema.TableColumn(schema);
				colvarPressSmall.ColumnName = "Press_small";
				colvarPressSmall.DataType = DbType.String;
				colvarPressSmall.MaxLength = 50;
				colvarPressSmall.AutoIncrement = false;
				colvarPressSmall.IsNullable = true;
				colvarPressSmall.IsPrimaryKey = false;
				colvarPressSmall.IsForeignKey = false;
				colvarPressSmall.IsReadOnly = false;
				colvarPressSmall.DefaultSetting = @"";
				colvarPressSmall.ForeignKeyTableName = "";
				schema.Columns.Add(colvarPressSmall);
				
				BaseSchema = schema;
				//add this schema to the provider
				//so we can query it later
				DataService.Providers["Adex"].AddSchema("TEMPLATE",schema);
			}
		}
		#endregion
		
		#region Props
		  
		[XmlAttribute("Id")]
		[Bindable(true)]
		public long Id 
		{
			get { return GetColumnValue<long>(Columns.Id); }
			set { SetColumnValue(Columns.Id, value); }
		}
		  
		[XmlAttribute("UserID")]
		[Bindable(true)]
		public int UserID 
		{
			get { return GetColumnValue<int>(Columns.UserID); }
			set { SetColumnValue(Columns.UserID, value); }
		}
		  
		[XmlAttribute("Slide1")]
		[Bindable(true)]
		public string Slide1 
		{
			get { return GetColumnValue<string>(Columns.Slide1); }
			set { SetColumnValue(Columns.Slide1, value); }
		}
		  
		[XmlAttribute("Slide2")]
		[Bindable(true)]
		public string Slide2 
		{
			get { return GetColumnValue<string>(Columns.Slide2); }
			set { SetColumnValue(Columns.Slide2, value); }
		}
		  
		[XmlAttribute("Slide3")]
		[Bindable(true)]
		public string Slide3 
		{
			get { return GetColumnValue<string>(Columns.Slide3); }
			set { SetColumnValue(Columns.Slide3, value); }
		}
		  
		[XmlAttribute("Slide4")]
		[Bindable(true)]
		public string Slide4 
		{
			get { return GetColumnValue<string>(Columns.Slide4); }
			set { SetColumnValue(Columns.Slide4, value); }
		}
		  
		[XmlAttribute("Slide5")]
		[Bindable(true)]
		public string Slide5 
		{
			get { return GetColumnValue<string>(Columns.Slide5); }
			set { SetColumnValue(Columns.Slide5, value); }
		}
		  
		[XmlAttribute("Slide6")]
		[Bindable(true)]
		public string Slide6 
		{
			get { return GetColumnValue<string>(Columns.Slide6); }
			set { SetColumnValue(Columns.Slide6, value); }
		}
		  
		[XmlAttribute("Slide7")]
		[Bindable(true)]
		public string Slide7 
		{
			get { return GetColumnValue<string>(Columns.Slide7); }
			set { SetColumnValue(Columns.Slide7, value); }
		}
		  
		[XmlAttribute("Slide8")]
		[Bindable(true)]
		public string Slide8 
		{
			get { return GetColumnValue<string>(Columns.Slide8); }
			set { SetColumnValue(Columns.Slide8, value); }
		}
		  
		[XmlAttribute("TvSmall")]
		[Bindable(true)]
		public string TvSmall 
		{
			get { return GetColumnValue<string>(Columns.TvSmall); }
			set { SetColumnValue(Columns.TvSmall, value); }
		}
		  
		[XmlAttribute("TvBig")]
		[Bindable(true)]
		public string TvBig 
		{
			get { return GetColumnValue<string>(Columns.TvBig); }
			set { SetColumnValue(Columns.TvBig, value); }
		}
		  
		[XmlAttribute("CableSmall")]
		[Bindable(true)]
		public string CableSmall 
		{
			get { return GetColumnValue<string>(Columns.CableSmall); }
			set { SetColumnValue(Columns.CableSmall, value); }
		}
		  
		[XmlAttribute("CableBig")]
		[Bindable(true)]
		public string CableBig 
		{
			get { return GetColumnValue<string>(Columns.CableBig); }
			set { SetColumnValue(Columns.CableBig, value); }
		}
		  
		[XmlAttribute("RadioSmall")]
		[Bindable(true)]
		public string RadioSmall 
		{
			get { return GetColumnValue<string>(Columns.RadioSmall); }
			set { SetColumnValue(Columns.RadioSmall, value); }
		}
		  
		[XmlAttribute("RadioBig")]
		[Bindable(true)]
		public string RadioBig 
		{
			get { return GetColumnValue<string>(Columns.RadioBig); }
			set { SetColumnValue(Columns.RadioBig, value); }
		}
		  
		[XmlAttribute("RadioIntSmall")]
		[Bindable(true)]
		public string RadioIntSmall 
		{
			get { return GetColumnValue<string>(Columns.RadioIntSmall); }
			set { SetColumnValue(Columns.RadioIntSmall, value); }
		}
		  
		[XmlAttribute("RadioIntBig")]
		[Bindable(true)]
		public string RadioIntBig 
		{
			get { return GetColumnValue<string>(Columns.RadioIntBig); }
			set { SetColumnValue(Columns.RadioIntBig, value); }
		}
		  
		[XmlAttribute("OutdoorSmall")]
		[Bindable(true)]
		public string OutdoorSmall 
		{
			get { return GetColumnValue<string>(Columns.OutdoorSmall); }
			set { SetColumnValue(Columns.OutdoorSmall, value); }
		}
		  
		[XmlAttribute("OutdoorBig")]
		[Bindable(true)]
		public string OutdoorBig 
		{
			get { return GetColumnValue<string>(Columns.OutdoorBig); }
			set { SetColumnValue(Columns.OutdoorBig, value); }
		}
		  
		[XmlAttribute("OutdoorIntSmall")]
		[Bindable(true)]
		public string OutdoorIntSmall 
		{
			get { return GetColumnValue<string>(Columns.OutdoorIntSmall); }
			set { SetColumnValue(Columns.OutdoorIntSmall, value); }
		}
		  
		[XmlAttribute("OutdoorIntBig")]
		[Bindable(true)]
		public string OutdoorIntBig 
		{
			get { return GetColumnValue<string>(Columns.OutdoorIntBig); }
			set { SetColumnValue(Columns.OutdoorIntBig, value); }
		}
		  
		[XmlAttribute("InternetBig")]
		[Bindable(true)]
		public string InternetBig 
		{
			get { return GetColumnValue<string>(Columns.InternetBig); }
			set { SetColumnValue(Columns.InternetBig, value); }
		}
		  
		[XmlAttribute("InternetSmall")]
		[Bindable(true)]
		public string InternetSmall 
		{
			get { return GetColumnValue<string>(Columns.InternetSmall); }
			set { SetColumnValue(Columns.InternetSmall, value); }
		}
		  
		[XmlAttribute("PressBig")]
		[Bindable(true)]
		public string PressBig 
		{
			get { return GetColumnValue<string>(Columns.PressBig); }
			set { SetColumnValue(Columns.PressBig, value); }
		}
		  
		[XmlAttribute("PressSmall")]
		[Bindable(true)]
		public string PressSmall 
		{
			get { return GetColumnValue<string>(Columns.PressSmall); }
			set { SetColumnValue(Columns.PressSmall, value); }
		}
		
		#endregion
		
		
			
		
		//no foreign key tables defined (0)
		
		
		
		//no ManyToMany tables defined (0)
		
        
        
		#region ObjectDataSource support
		
		
		/// <summary>
		/// Inserts a record, can be used with the Object Data Source
		/// </summary>
		public static void Insert(int varUserID,string varSlide1,string varSlide2,string varSlide3,string varSlide4,string varSlide5,string varSlide6,string varSlide7,string varSlide8,string varTvSmall,string varTvBig,string varCableSmall,string varCableBig,string varRadioSmall,string varRadioBig,string varRadioIntSmall,string varRadioIntBig,string varOutdoorSmall,string varOutdoorBig,string varOutdoorIntSmall,string varOutdoorIntBig,string varInternetBig,string varInternetSmall,string varPressBig,string varPressSmall)
		{
			Template item = new Template();
			
			item.UserID = varUserID;
			
			item.Slide1 = varSlide1;
			
			item.Slide2 = varSlide2;
			
			item.Slide3 = varSlide3;
			
			item.Slide4 = varSlide4;
			
			item.Slide5 = varSlide5;
			
			item.Slide6 = varSlide6;
			
			item.Slide7 = varSlide7;
			
			item.Slide8 = varSlide8;
			
			item.TvSmall = varTvSmall;
			
			item.TvBig = varTvBig;
			
			item.CableSmall = varCableSmall;
			
			item.CableBig = varCableBig;
			
			item.RadioSmall = varRadioSmall;
			
			item.RadioBig = varRadioBig;
			
			item.RadioIntSmall = varRadioIntSmall;
			
			item.RadioIntBig = varRadioIntBig;
			
			item.OutdoorSmall = varOutdoorSmall;
			
			item.OutdoorBig = varOutdoorBig;
			
			item.OutdoorIntSmall = varOutdoorIntSmall;
			
			item.OutdoorIntBig = varOutdoorIntBig;
			
			item.InternetBig = varInternetBig;
			
			item.InternetSmall = varInternetSmall;
			
			item.PressBig = varPressBig;
			
			item.PressSmall = varPressSmall;
			
		
			if (System.Web.HttpContext.Current != null)
				item.Save(System.Web.HttpContext.Current.User.Identity.Name);
			else
				item.Save(System.Threading.Thread.CurrentPrincipal.Identity.Name);
		}
		
		/// <summary>
		/// Updates a record, can be used with the Object Data Source
		/// </summary>
		public static void Update(long varId,int varUserID,string varSlide1,string varSlide2,string varSlide3,string varSlide4,string varSlide5,string varSlide6,string varSlide7,string varSlide8,string varTvSmall,string varTvBig,string varCableSmall,string varCableBig,string varRadioSmall,string varRadioBig,string varRadioIntSmall,string varRadioIntBig,string varOutdoorSmall,string varOutdoorBig,string varOutdoorIntSmall,string varOutdoorIntBig,string varInternetBig,string varInternetSmall,string varPressBig,string varPressSmall)
		{
			Template item = new Template();
			
				item.Id = varId;
			
				item.UserID = varUserID;
			
				item.Slide1 = varSlide1;
			
				item.Slide2 = varSlide2;
			
				item.Slide3 = varSlide3;
			
				item.Slide4 = varSlide4;
			
				item.Slide5 = varSlide5;
			
				item.Slide6 = varSlide6;
			
				item.Slide7 = varSlide7;
			
				item.Slide8 = varSlide8;
			
				item.TvSmall = varTvSmall;
			
				item.TvBig = varTvBig;
			
				item.CableSmall = varCableSmall;
			
				item.CableBig = varCableBig;
			
				item.RadioSmall = varRadioSmall;
			
				item.RadioBig = varRadioBig;
			
				item.RadioIntSmall = varRadioIntSmall;
			
				item.RadioIntBig = varRadioIntBig;
			
				item.OutdoorSmall = varOutdoorSmall;
			
				item.OutdoorBig = varOutdoorBig;
			
				item.OutdoorIntSmall = varOutdoorIntSmall;
			
				item.OutdoorIntBig = varOutdoorIntBig;
			
				item.InternetBig = varInternetBig;
			
				item.InternetSmall = varInternetSmall;
			
				item.PressBig = varPressBig;
			
				item.PressSmall = varPressSmall;
			
			item.IsNew = false;
			if (System.Web.HttpContext.Current != null)
				item.Save(System.Web.HttpContext.Current.User.Identity.Name);
			else
				item.Save(System.Threading.Thread.CurrentPrincipal.Identity.Name);
		}
		#endregion
        
        
        
        #region Typed Columns
        
        
        public static TableSchema.TableColumn IdColumn
        {
            get { return Schema.Columns[0]; }
        }
        
        
        
        public static TableSchema.TableColumn UserIDColumn
        {
            get { return Schema.Columns[1]; }
        }
        
        
        
        public static TableSchema.TableColumn Slide1Column
        {
            get { return Schema.Columns[2]; }
        }
        
        
        
        public static TableSchema.TableColumn Slide2Column
        {
            get { return Schema.Columns[3]; }
        }
        
        
        
        public static TableSchema.TableColumn Slide3Column
        {
            get { return Schema.Columns[4]; }
        }
        
        
        
        public static TableSchema.TableColumn Slide4Column
        {
            get { return Schema.Columns[5]; }
        }
        
        
        
        public static TableSchema.TableColumn Slide5Column
        {
            get { return Schema.Columns[6]; }
        }
        
        
        
        public static TableSchema.TableColumn Slide6Column
        {
            get { return Schema.Columns[7]; }
        }
        
        
        
        public static TableSchema.TableColumn Slide7Column
        {
            get { return Schema.Columns[8]; }
        }
        
        
        
        public static TableSchema.TableColumn Slide8Column
        {
            get { return Schema.Columns[9]; }
        }
        
        
        
        public static TableSchema.TableColumn TvSmallColumn
        {
            get { return Schema.Columns[10]; }
        }
        
        
        
        public static TableSchema.TableColumn TvBigColumn
        {
            get { return Schema.Columns[11]; }
        }
        
        
        
        public static TableSchema.TableColumn CableSmallColumn
        {
            get { return Schema.Columns[12]; }
        }
        
        
        
        public static TableSchema.TableColumn CableBigColumn
        {
            get { return Schema.Columns[13]; }
        }
        
        
        
        public static TableSchema.TableColumn RadioSmallColumn
        {
            get { return Schema.Columns[14]; }
        }
        
        
        
        public static TableSchema.TableColumn RadioBigColumn
        {
            get { return Schema.Columns[15]; }
        }
        
        
        
        public static TableSchema.TableColumn RadioIntSmallColumn
        {
            get { return Schema.Columns[16]; }
        }
        
        
        
        public static TableSchema.TableColumn RadioIntBigColumn
        {
            get { return Schema.Columns[17]; }
        }
        
        
        
        public static TableSchema.TableColumn OutdoorSmallColumn
        {
            get { return Schema.Columns[18]; }
        }
        
        
        
        public static TableSchema.TableColumn OutdoorBigColumn
        {
            get { return Schema.Columns[19]; }
        }
        
        
        
        public static TableSchema.TableColumn OutdoorIntSmallColumn
        {
            get { return Schema.Columns[20]; }
        }
        
        
        
        public static TableSchema.TableColumn OutdoorIntBigColumn
        {
            get { return Schema.Columns[21]; }
        }
        
        
        
        public static TableSchema.TableColumn InternetBigColumn
        {
            get { return Schema.Columns[22]; }
        }
        
        
        
        public static TableSchema.TableColumn InternetSmallColumn
        {
            get { return Schema.Columns[23]; }
        }
        
        
        
        public static TableSchema.TableColumn PressBigColumn
        {
            get { return Schema.Columns[24]; }
        }
        
        
        
        public static TableSchema.TableColumn PressSmallColumn
        {
            get { return Schema.Columns[25]; }
        }
        
        
        
        #endregion
		#region Columns Struct
		public struct Columns
		{
			 public static string Id = @"ID";
			 public static string UserID = @"UserID";
			 public static string Slide1 = @"Slide1";
			 public static string Slide2 = @"Slide2";
			 public static string Slide3 = @"Slide3";
			 public static string Slide4 = @"Slide4";
			 public static string Slide5 = @"Slide5";
			 public static string Slide6 = @"Slide6";
			 public static string Slide7 = @"Slide7";
			 public static string Slide8 = @"Slide8";
			 public static string TvSmall = @"TV_small";
			 public static string TvBig = @"TV_Big";
			 public static string CableSmall = @"cable_small";
			 public static string CableBig = @"Cable_Big";
			 public static string RadioSmall = @"Radio_small";
			 public static string RadioBig = @"Radio_Big";
			 public static string RadioIntSmall = @"Radio_Int_small";
			 public static string RadioIntBig = @"Radio_Int_Big";
			 public static string OutdoorSmall = @"Outdoor_small";
			 public static string OutdoorBig = @"Outdoor_Big";
			 public static string OutdoorIntSmall = @"Outdoor_Int_small";
			 public static string OutdoorIntBig = @"Outdoor_Int_Big";
			 public static string InternetBig = @"Internet_big";
			 public static string InternetSmall = @"Internet_small";
			 public static string PressBig = @"Press_Big";
			 public static string PressSmall = @"Press_small";
						
		}
		#endregion
		
		#region Update PK Collections
		
        #endregion
    
        #region Deep Save
		
        #endregion
	}
}
